package com.daniel.io.stream;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * 详细说明
 *
 * @author Daniel
 * @version V1.0
 * @date 2020/6/17 09:19
 */
public class TestReader {

    public static void main(String[] args) {
        BufferedReader br = null;

        try {
            // 字符流用来读取字符数据，对于输入字符流而言，最为常用操作方法是使用BufferedReader
            // 因为该流有一个readLine()
            br = new BufferedReader(new FileReader("C:\\Users\\Administrator\\Desktop\\j2se_源码和思维导图\\eclipse\\Lesson21\\src\\stream\\TestFileOutputStream.java"));
            String str = null;
            while ((str = br.readLine()) != null) {
                System.out.println(str);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
